#! /bin/bash

#Script used to test Grades.jar

set pass = 0
set fail = 0

echo "Start of Script"
echo "Test Case 1: Testing 10/39"
echo "Test Case 1: 10/39 Component Fail"
java -jar Grades.jar 10 39
if [$returnvalue == "Fail"] then fail++
elif [$returnvalue == "Pass"] then pass++

echo "----------------------"
echo "Test Case 2: Testing 40/50"
echo "Test Case 2: 40/50 Component Fail"
java -jar Grades.jar 40 50
if [$returnvalue == "Fail"] then ((fail++))
elif [$returnvalue == "Pass"] then ((pass++))

echo "----------------------"
echo "Test Case 3: 52/70"
echo "Test Case 3: 52/70 Pass"
java -jar Grades.jar 52 70
if [$returnvalue == "Fail"] then ((fail++))
elif [$returnvalue == "Pass"] then ((pass++))

echo "----------------------"
echo "Test Case 4: 72/80"
echo "Test Case 4: 72/80 Pass"
java -jar Grades.jar 72 80
if [$returnvalue == "Fail"] then ((fail++))
elif [$returnvalue == "Pass"] then ((pass++))

echo "----------------------"
echo "Test Case 5: 82/90"
echo "Test Case 5: 82/90 Pass with Distinction"
java -jar Grades.jar 82 90
if [$returnvalue == "Fail"] then ((fail++))
elif [$returnvalue == "Pass"] then ((pass++))

echo "----------------------"
echo "Test Case 6: 91/100"
echo "Test Case 6: 91/100 Pass with Distinction"
java -jar Grades.jar 91 100
if [$returnvalue == "Fail"] then ((fail++))
elif [$returnvalue == "Pass"] then ((pass++))

echo "----------------------"
echo "Test Case 7: 100/100"
echo "Test Case 7: 100/100 Pass with Distinction"
java -jar Grades.jar 100 100
if [$returnvalue == "Fail"] then ((fail++))
elif [$returnvalue == "Pass"] then ((pass++))


echo   "================"
echo "test report statistics"
echo   "================"

echo "passed :"  $pass
echo "failed: "  $fail
